set index to column pandas

47

pandas df make set index column -

df.reset_index(inplace=True)
df = df.rename(columns = {'index':'new column name'})

Pandas Set index -

>>> college_idx = college.set_index('instnm')>>> sats = college_idx[['satmtmid', 'satvrmid']].dropna()>>> sats.head()

Comments

Submit
0 Comments